<template>
    <div>
        <ul><li v-for="m in messageList" :key="m.id">
            <!-- 用模板字符串混入变量 --> 
            <!-- to的字符串写法 -->
            <!-- <router-link :to='`/home/message/detail?id=${m.id}&title=${m.title}`'>详情</router-link> -->
            <!-- to的对象写法 -->
            <router-link :to="{
                // path:'/home/message/detail',
                // 可以用命名去替换路径
                name:'xiangqing',
                query:{
                    id:m.id,
                    titel:m.title,
                }
            }">
            {{m.title}}
            </router-link>
        </li></ul>
        <hr>
        <router-view></router-view>
    </div>
</template>

<script>
    export default {
        name : "Message",
        data(){
            return {
                messageList:[
                    {id:"001",title:"zzz"},
                    {id:"002",title:"zzz2"},
                ]
            }
        }
    }
</script>

<style scoped>

</style>